.class public Lcom/esfile/screen/recorder/picture/pngj/a;
.super Ljava/lang/Object;
.source "IDatChunkWriter.java"


# instance fields
.field private final a:Ljava/io/OutputStream;

.field private final b:I

.field private c:[B

.field private d:I

.field private e:I

.field private f:J

.field private g:I


# direct methods
.method public constructor <init>(Ljava/io/OutputStream;I)V
    .locals 3

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->d:I

    const-wide/16 v1, 0x0

    .line 3
    iput-wide v1, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->f:J

    .line 4
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->g:I

    .line 5
    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->a:Ljava/io/OutputStream;

    if-lez p2, :cond_0

    goto :goto_0

    :cond_0
    const p2, 0x8000

    .line 6
    :goto_0
    iput p2, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->b:I

    .line 7
    new-array p1, p2, [B

    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->c:[B

    .line 8
    iget p1, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->d:I

    sub-int/2addr p2, p1

    iput p2, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->e:I

    .line 9
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/picture/pngj/a;->h()V

    return-void
.end method


# virtual methods
.method public a()V
    .locals 1

    .line 5
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/picture/pngj/a;->b()V

    const/4 v0, 0x0

    .line 6
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->d:I

    const/4 v0, 0x0

    .line 7
    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->c:[B

    return-void
.end method

.method public a(I)V
    .locals 1

    .line 1
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->d:I

    add-int/2addr v0, p1

    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->d:I

    .line 2
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->e:I

    sub-int/2addr v0, p1

    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->e:I

    if-ltz v0, :cond_1

    if-nez v0, :cond_0

    .line 3
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/picture/pngj/a;->b()V

    :cond_0
    return-void

    .line 4
    :cond_1
    new-instance p1, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;

    const-string v0, "Anomalous situation"

    invoke-direct {p1, v0}, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public final b()V
    .locals 6

    .line 1
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->d:I

    if-lez v0, :cond_0

    invoke-virtual {p0}, Lcom/esfile/screen/recorder/picture/pngj/a;->g()I

    move-result v1

    if-lt v0, v1, :cond_0

    .line 2
    new-instance v0, Lcom/esfile/screen/recorder/picture/pngj/chunks/c;

    iget v1, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->d:I

    invoke-virtual {p0}, Lcom/esfile/screen/recorder/picture/pngj/a;->e()[B

    move-result-object v2

    const/4 v3, 0x0

    invoke-direct {v0, v1, v2, v3}, Lcom/esfile/screen/recorder/picture/pngj/chunks/c;-><init>(I[BZ)V

    .line 3
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->c:[B

    iput-object v1, v0, Lcom/esfile/screen/recorder/picture/pngj/chunks/c;->d:[B

    .line 4
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->a:Ljava/io/OutputStream;

    invoke-virtual {v0, v1}, Lcom/esfile/screen/recorder/picture/pngj/chunks/c;->a(Ljava/io/OutputStream;)V

    .line 5
    iget-wide v1, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->f:J

    iget v0, v0, Lcom/esfile/screen/recorder/picture/pngj/chunks/c;->a:I

    add-int/lit8 v0, v0, 0xc

    int-to-long v4, v0

    add-long/2addr v1, v4

    iput-wide v1, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->f:J

    .line 6
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->g:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->g:I

    .line 7
    iput v3, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->d:I

    .line 8
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->b:I

    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->e:I

    .line 9
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/picture/pngj/a;->h()V

    :cond_0
    return-void
.end method

.method public c()I
    .locals 1

    .line 1
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->e:I

    return v0
.end method

.method public d()[B
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->c:[B

    return-object v0
.end method

.method protected e()[B
    .locals 1

    .line 1
    sget-object v0, Lcom/esfile/screen/recorder/picture/pngj/chunks/a;->b:[B

    return-object v0
.end method

.method public f()I
    .locals 1

    .line 1
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/a;->d:I

    return v0
.end method

.method protected g()I
    .locals 1

    const/4 v0, 0x1

    return v0
.end method

.method protected h()V
    .locals 0

    return-void
.end method
